/*
 * @Author: Starfish_DL
 * @Date: 2020-11-21 23:32:05
 * @LastEditors: Starfish_DL
 * @LastEditTime: 2020-11-22 17:05:59
 * @CurrentVersion: 1.0
 * @Description:
 */

#pragma once
#ifndef ADJGRAPH_H
#define ADJGRAPH_H
#include"MatGraph.h"
#include"LinkQueueBox.h"

class ArcNode
{
public:
    Box adjvex;
    int weight;
    ArcNode* nextarc;
    ArcNode(Box a);
    ArcNode(Box a, int weight);
    ArcNode(Box a, ArcNode* next);
    ArcNode(Box a, int weight, ArcNode* next);
    ~ArcNode();
};

class VNode
{
public:
    Box data;
    ArcNode* first;
    VNode();
    VNode(Box data);
    VNode(Box data, ArcNode* f);
    ~VNode();
};

class AdjGraph
{
public:
    VNode adjlist[MAXVER_MATGRAPH*MAXVER_MATGRAPH];
    int n, e;
    AdjGraph(MatGraph *m);
    void DispGraph();
    void DFS(Box v);
    void BFS(Box v);
    void DFSMapRecursion(Box start, Box end, Box *path = new Box[MAXVER_MATGRAPH*MAXVER_MATGRAPH], int step = -1);
    void BFSMap(Box start, Box end);
    ~AdjGraph();
};

#endif // !ADJGRAPH_H